home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / gwada / readme < prev   
Text File  |  1994-10-29  |  9KB  |  235 lines

  1.  
  2.  
  3.                         INSTRUCTIONS
  4.                         ------------
  5.  
  6. Installation:
  7. ------------
  8.         On unzipping the file gw386.zip (using -d option), two directories
  9.     (bin and work) are created. `Bin' contains the executables and certain
  10.     support files necessary for the execution of this software. Setup a path
  11.     <path> to access the bin directory. Also set the ADAED environment
  12.     variable (set ADAED=<path>).The `Work' directory contains some Ada
  13.     packages which are required for the "Sample Run" described at the end of
  14.     this document. The software now uses the huge memory model (instead of
  15.     the compact memory model).
  16.  
  17.  
  18. Introduction:
  19. ------------
  20.         An additional feature has been added to the GWAda Development
  21.     Environment. This feature allows the user to develop and test Ada
  22.     packages without writing driver programs (executable program units) to
  23.     test them. To enable this, the Environment has two modes now --
  24.     `Normal Mode' and `Package Unit Test Mode'. `Normal Mode' is the original
  25.     GWAda Environment window which appears  on entering the environment. All
  26.     its original functions have been preserved. The `Package Unit Test Mode'
  27.     is used to test Ada packages and its operation has been outlined below.
  28.         General instructions to use this software follow immediately, but
  29.     the user may skip over to the "Sample Run" section given at the end.
  30.  
  31.  
  32. To use the `Package Unit Test Mode':
  33. ----------------------------------
  34.     This mode allows the user to edit and test packages which meet certain
  35.     restrictions (see Unit Test restrictions on a package). Facility is
  36.     provided to automatically generate and run driver programs for these
  37.     packages. The driver programs operate in a manner similar to conventional
  38.     interpreters.
  39.  
  40.     1. Once in the GWAda environment press F2  or  ALT-O-M to switch to
  41.        Unit Test Mode.
  42.  
  43.     2. The available top menus are:
  44.        FILE, EDIT, COMPILE, INSTRUMENT, RUN, WINDOW, OPTIONS, ADA, and HELP.
  45.           The menus FILE, EDIT, WINDOW, ADA, and HELP are identical to
  46.        those in the `Normal Mode' (Normal mode is the original screen
  47.        which appears when GWAda environment is first entered).
  48.           Only COMPILE, INSTRUMENT, RUN, and OPTIONS are different as
  49.        outlined below.
  50.  
  51.     3. OPTIONS:
  52.        An additional menu item `Mode Normal' has been provided to swich
  53.        back to normal mode. Of course, the F2 hot key can also be used to
  54.        switch back and forth.
  55.  
  56.     3. COMPILE:
  57.        This works similar to the COMPILE option in `Normal Mode'. In addition,
  58.        if you compile a package which meets the restrictions outlined in
  59.        section  "Unit Test restrictions on a package", it appears under the
  60.        INSTRUMENT menu.
  61.  
  62.     4. INSTRUMENT:
  63.        Select the package you want to instrument. This will automatically
  64.        generate, compile and, bind a driver (interpreter) for this package.
  65.        On success, the driver will appear under the RUN menu.
  66.  
  67.     5. RUN:
  68.        Select the driver you want to run. This will take you to the
  69.        interpreter screen with a command line prompt which looks like ">".
  70.        See the section "To use the Interpreter" in order to use the
  71.        interpreter commands.
  72.  
  73.  
  74. To use the Interpreter:
  75. ----------------------
  76.     1. The interpreter commands are as follows:
  77.            TYPES
  78.            TREE
  79.            OPS <type>
  80.            NEW <type>
  81.            OBJECTS <type>
  82.            HISTORY [<type>.]<object>
  83.            EXIT
  84.            HELP
  85.         <type> refers to the data type exported by the package under test.
  86.         <object> refers to the name of an instantiated object
  87.  
  88.     2. TYPES:
  89.        Lists all the available data types which can be tested. It basically
  90.        lists the type exported by the package under test and also the type
  91.        exported by its ancestor packages (packages used by the package under
  92.        test recursively).
  93.        Example: If package PV exports type V, and uses packages PW and PX
  94.                 which export types W and X respectively. Also, if package
  95.                 PW uses package PZ which exports type Z then this command
  96.                 will list the following:
  97.                 V
  98.                 W
  99.                 X
  100.                 Z
  101.  
  102.     3. TREE:
  103.        Shows the type composition tree.
  104.  
  105.        Example: Using the above example this command will show:
  106.                 V  depends on  W
  107.                 V  depends on  X
  108.                 W  depends on  Z
  109.  
  110.     4. OPS <type>:
  111.        Shows available operations of specified type. This provides a handy
  112.        lookup table when invoking operations on an object of a particular type.
  113.        Example: OPS V
  114.  
  115.     5. NEW <type>:
  116.        Instantiates an object of a specified type and prompts the user for
  117.        its name.
  118.        Example: NEW  V
  119.                 Enter a name: Ob1
  120.                 (This instantiates an object Ob1 of type V)
  121.  
  122.     6. OBJECTS <type>:
  123.        Shows names of all available objects of specified type
  124.        Example: OBJECTS V       -- may list the following objects
  125.                 Ob1
  126.                 Ob2
  127.  
  128.     7. HISTORY [<type>.]<object>:
  129.        Shows a history of all commands invoked on specified object.
  130.        Example: HISTORY  V.Ob1
  131.                 ... will show all commands invoked on object Ob1 of type V...
  132.  
  133.     8. EXIT:
  134.        Exits the interpreter and returns to GWAda development environment
  135.  
  136.     9. HELP:
  137.        Displays the above mentioned interpreter commands.
  138.  
  139.    10. Operations (defined in the package under test):
  140.        All operations defined on available types can be invoked on
  141.        their objects.
  142.        Example: if a type STACK has operations
  143.                 PUSH(in out STACK, INTEGER);
  144.                 IS_EMPTY(in STACK);  etc...
  145.                 defined on it then they may be invoked on its objects S1, S2
  146.                 as follows:
  147.  
  148.                 > STACK.PUSH(S1, 10);
  149.                 > STACK.IS_EMPTY(S2);
  150.  
  151.  
  152. Unit Test restrictions on a package:
  153. -----------------------------------
  154.     Some of the following restrictions apply to the packages under test
  155.     because they (the packages) are expected to export abstract data types.
  156.     Other restrictions are there because this software is still under
  157.     development. Most of the restrictions (if not all) will be removed
  158.     in future versions of this product.
  159.  
  160.     1. The Ada package under test must export exactly one type.
  161.     2. The package must be a non-generic.
  162.     3. The exported type should not be a derived type.
  163.     4. Every procedure or function in the package must pass the exported
  164.        type as a parameter.
  165.     5. The package under test must be present in the current directory.
  166.     6. To include ancestor types, their source files must be present in
  167.        the current directory.
  168.  
  169.  
  170. Sample Run
  171. ----------
  172.     This run pertains to the sample package LISTPKG.ADA provided with this
  173.     software.
  174.  
  175.     1. Invoke the GWAda Environment (and create a new library)
  176.     2. Press F2 to switch to `Package Unit Test Mode'
  177.     3. Compile EASY_IO.ADA and LISTPKG.ADA
  178.     4. Instrument LIST_PACKAGE
  179.     5. Run LIST_PACKAGE_DRIVER
  180.  
  181.     6. At the ">" prompt, type the following commands. The interpreter
  182.        response is also shown below.
  183.        > HELP
  184.              INTERPRETER COMMANDS
  185.              ----------- --------
  186.              types
  187.              tree
  188.              ops <Type>
  189.              objects <Type>
  190.              history [<Type>.]<Object>
  191.              help
  192.              new <Type>
  193.              exit
  194.        > TYPES
  195.              LIST
  196.        > OPS LIST
  197.              DISPLAY(IN LIST);
  198.              INSERT_HEAD(IN-OUT LIST; IN INTEGER);
  199.              INSERT_TAIL(IN-OUT LIST; IN INTEGER);
  200.              DEL_HEAD(IN-OUT LIST; OUT INTEGER);
  201.              COPY(IN-OUT LIST; IN LIST);
  202.              EQUAL(IN LIST; IN LIST) return BOOLEAN;
  203.        > NEW LIST
  204.              Enter a name: L1
  205.        > NEW LIST
  206.              Enter a name: L2
  207.        > DISPLAY(L1);
  208.                 <       >
  209.        > INSERT_HEAD(L1, 10);
  210.        > INSERT_HEAD(L1, 20);
  211.        > INSERT_TAIL(L1, 5);
  212.        > DISPLAY(L1);
  213.                 <       20      10      5      >
  214.        > EQUAL(L1, L2);
  215.              Return Value = FALSE
  216.        > COPY(L2, L1);
  217.        > EQUAL(L1, L2);
  218.              Return Value = TRUE
  219.        > DISPLAY(L2);
  220.                 <       20      10      5      >
  221.        > DEL_HEAD(L2, X);
  222.              X =     20
  223.        > DISPLAY(L2);
  224.                 <       10       5      >
  225.        > EXIT
  226.  
  227.     7. To run other packages, compile, interpret, and run  QUEPKG.ADA and
  228.        STACKPKG.ADA. STACKPKG.ADA defines the package STACK_PACKAGE which
  229.        uses QUEUE_PACKAGE (defined in QUEPKG.ADA) which in turn uses
  230.        LIST_PACKAGE (defined in LISTPKG.ADA). STACK_PACKAGE exports type
  231.        STACK, which is basically a stack of queues.
  232.  
  233.  
  234.  
  235.